
<div class="portlet box blue-hoki" ng-controller='application_controller'>
    <div class="portlet-title">
        <div class="caption">
            <i class="fa fa-globe"></i>Leave application record list
        </div>
        <!---------------按钮------------------>
        <div class="toolbox">
		    <span class='fa fa-spinner fa-spin' 
		    	ng-show='uploading'>
		    </span>
		    <span get-excel 
		    	title="export content as excel" 
		    	data='records' 
		    	heads='heads' 
		    	url='/attendance/getexcel/' 
		    	class="fa fa-sort-amount-desc toolbtn">
		    </span>
		    <span class="fa fa-save toolbtn" 
		    	aria-hidden="true" 
		    	ng-click='update_to_server()' 
		    	title='save to server'>
		    </span>
        </div>
    </div>
    <div class="portlet-body" >
   	<!------- 过滤器---------->
  	<div ng-include='"filter_box.html"' onload='search=search'></div>
  	<!------- 表格---------->
    <table class="table table-striped table-bordered table-hover" id="sample_1">
        <thead>
             <tr>
	            <th ng-repeat='head in heads '>
		            <span ng-bind='head.label'></span>
		            <span style='float: right;margin-right:20px;' 
		            	ng-show='head.editor=="text"' 
		            	class="glyphicon glyphicon-pencil" aria-hidden="true">
		            </span> 
		            <!--head[ [[head.name]]+"_filter"]-->
		            <span ng-if='head.filter' >
			            <span head-filter 
			            	items='org_records' 
			            	name='[[head.name]]' 
			            	self='head._filter'>
				            <span class="glyphicon glyphicon-filter" aria-hidden="true"></span>
				        </span>
			        </span>
		            
		           <span sort-mark name='head.name' items='records'></span>
	            </th>
            </tr>
        </thead>
        
    <tbody>
       	<tr ng-repeat='record in records | offset: currentPage*itemsPerPage | limitTo: itemsPerPage'>
        	<td ng-bind='record.empid'></td>
            <td ng-bind='record.name'></td>
            <td ng-bind='record.create_time'></td>
            <td ng-bind='record.category'></td>
			<!-------------申请开始时间------------->
            <td ng-class='{"dirty":record.start_time_dirty}' 
            	class='editable' 
            	ng-click='record.start_time_editor.show()'>
	           <span text-input
	           		self='record.start_time_editor'
	           	 	model='record.start_time' 
	           	 	onchanged='record.start_time_dirty=true;record.dirty=true' 
	           	 	width='130px' 
	           	 	pattern='^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}$' >
           	 	</span>
           </td>
            <!----------申请结束时间------------->
           	<td ng-class='{"dirty":record.end_time_dirty}' 
           		class='editable' 
           		ng-click='record.end_time_editor.show()'>
	           <span text-input 
           			self='record.end_time_editor' 
   					model='record.end_time'  
   					onchanged='record.end_time_dirty=true;record.dirty=true' 
   					width='130px' 
   					pattern='^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}$'>
	           </span>
           </td>
           <!-----------进度框---------------->
           <td ng-class='{"dirty":record.check_record_dirty}'>
               <div class="dropdown dropdown-extended app-box">
				<a href="javascript:;" 
					class="app-span dropdown-toggle" 
					data-toggle="dropdown" 
					data-close-others="true">		
					<span ng-class='check.status' 
						ng-repeat='check in record.check_record' 
						ng-bind='check.name'>
						刘海龙
					</span>
				</a>
				<!----------进度下拉选择框-------------->
				<ul class="dropdown-menu scroller">
					<li ng-repeat='check in record.check_record'>
						<span class="name_span" 
							ng-bind='check.name'>
							刘海龙
						</span>
						<span text-select
							class="status_span" 
							ng-class='check.status'  
							model='check.status' 
							options='["approved","rejected","pending"]' 
							onchanged='record.check_record_dirty=true;record.dirty=true'>
							Approved
						</span>
						<span class="note_span" >
							Note : 
							<span ng-bind='check.note'>
								新春快乐！！！
							</span>
						</span>
						<span class="time_span" 
							ng-bind='check.time'>
							2016-02-01 16:21
						</span>
						<span class="clearfix">.</span>
					</li>
				
				</ul>
			   </div>
           </td>
           <!--------------------------------->
			<td ng-class='{"dirty":record.status_dirty}'>
				<span text-select
					self='record.status_editor'
					model='record.status' 
					class='editable' 
					onchanged='record.status_dirty=true;record.dirty=true' 
					options='["pending","revoked"]'>
				</span>
			</td>

            <td ng-class='{"dirty":record.note_dirty}' 
              	class='editable'
              	ng-click='record.note_editor.show()'>
                <span text-input 
            		self='record.note_editor'
            		model='record.note' 
            		onchanged='record.note_dirty=true;record.dirty=true' 
            		width='100px' >
                </span>
            </td>

       </tr>
       </tbody>
    </table>

    <div page-foot 
    	per='itemsPerPage' 
    	crt='currentPage' 
    	items='records' 
    	style='text-align: right;'>
    </div>
  </div>
</div>

